package com.group3.fallback.payment;

import com.group3.Feign.PaymentSeviceFeign;
import com.group3.model.Payment;
import org.springframework.stereotype.Component;

import java.util.List;
@Component
public class PaymentServiceFallback implements PaymentSeviceFeign {
    @Override
    public List<Payment> getPaymentList() {
        Payment payment = new Payment();
         payment.setStatus(0);
         payment.setPid(0);
          payment.setOid(0);
          payment.setPname("支付服务不可用");
          List <Payment> list = List.of(payment);
        return list;
    }

    @Override
    public Payment getPaymentById(Integer id) {
        Payment payment = new Payment();
        payment.setStatus(0);
        payment.setPid(0);
        payment.setOid(0);
        payment.setPname("支付服务不可用");
        return payment;
    }

    @Override
    public Payment getPaymentByOid(Integer oid) {
        Payment payment = new Payment();
        payment.setStatus(0);
        payment.setPid(0);
        payment.setOid(0);
        payment.setPname("支付服务不可用");
        return payment;
    }

    @Override
    public Payment paymentOrder(Integer oid) {
        Payment payment = new Payment();
        payment.setStatus(0);
        payment.setPid(0);
        payment.setOid(0);
        payment.setPname("支付服务不可用");
        return payment;
    }

    @Override
    public boolean refundOrder(Integer oid) {
        return false;
    }

    @Override
    public boolean initiateRefund(Integer oid) {
        return false;
    }
}
